package panelVisual;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.swing.JPanel;


public class JPanelImagen extends JPanel implements java.io.Serializable {

	private ImageIcon imagen; 
	

	public ImageIcon getImagen() {
		return imagen;
	}


	public void setImagen(ImageIcon imagen) {
		this.imagen = imagen;
	}

	public JPanelImagen() {
		super();		
		this.setLayout(null);		
	}	
	
	public JPanelImagen(ImageIcon imagen) {
		super();		
		this.imagen = imagen;
		this.setLayout(null);		
	}	
	
	@Override
	public void paintComponent(Graphics g) {
		if (this.imagen!=null)
		{
			Image image = imagen.getImage();
			g.drawImage(image, 0, 0, this.getParent().getWidth(), this.getParent().getHeight(), null);
			setOpaque(false);
		}	
	    super.paintComponent(g);
	}
	
}